<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<script>
require([
    'jquery',
    'mage/template',
    'prototype'
], function(jQuery, mageTemplate){

setSettings = function(urlTemplate, codeElement, themeElement) {
    var url;

    if (!jQuery('#edit_form').valid()) {
        return false;
    }
    codeElement = $F(codeElement);
    themeElement = $F(themeElement);

    url = mageTemplate(urlTemplate, {
        data: {
            'code': codeElement,
            'theme_id': themeElement
        }
    });

    setLocation(url);
};
});
</script>
